﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master" AutoEventWireup="true" CodeBehind="AddDesignation.aspx.cs" Inherits="HRM.UI.HRManagerUI.Configuration.AddDesignation" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
     <link href="../../../Styles/Configuration/AddEmployeeCss.css" rel="stylesheet" type="text/css" />
    <link href="../../../Styles/Configuration/AddDesignationCss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

        function CheckField() {
            if (document.getElementById("<%=txtDesignationName.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Designation Name!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtDesignationName.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtGradeName.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Designation Grade!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtGradeName.ClientID%>").focus();
                return false;
            }
            return true;
        }
  
    </script>
    <fieldset>
        <legend>Add Designation</legend>
        <table class="AddDesignationTB">
            <tr>
                <td colspan="2" class="msgLabeltd">
                  <p class="msgTxt"><asp:Label runat="server" ID="msgLabel"></asp:Label></p>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Designation
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtDesignationName" class="textboxinput" /><span
                        class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Grade
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtGradeName" class="textboxinput" /><span
                        class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                </td>
                <td class="Field">
                    <input type="submit" onserverclick="SaveDesignation" runat="server" id="addDesignation"
                        value="Add" class="btnCss" onclick="return CheckField()" />
                </td>
            </tr>
        </table>
    </fieldset>
    <br/>
    <fieldset>
        <legend>Designation List</legend>
        <div align="center">
        <asp:GridView runat="server" ID="designationGridview" AutoGenerateColumns="False" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
            CellPadding="3" CssClass="GridviewStyle" ForeColor="Black" GridLines="Vertical"
            OnRowCancelingEdit="designationGridview_RowCancelingEdit" OnRowDeleting="designationGridview_RowDeleting"
            OnRowEditing="designationGridview_RowEditing" OnRowUpdating="designationGridview_RowUpdating"
            OnPageIndexChanging="designationGridview_PageIndexChanging" AllowPaging="True" PageSize="8" Width="60%">
            <AlternatingRowStyle/>
            <Columns>
                <asp:TemplateField runat="server" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Designation">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDesignation" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Grade">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Grade") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtGrade" runat="server" Text='<%# Bind("Grade") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" HeaderText="Edit" />
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%# Bind("Id")%>'
                            CommandName="Delete" Text="Delete" OnClientClick="return confirm('Do you want to delete this catagory?')">
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle CssClass="GridViewFooterStyle" />
            <HeaderStyle CssClass="GridViewHeaderStyle" />
            <PagerStyle CssClass="GridViewFooterStyle" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        </div>
    </fieldset>
</asp:Content>
